/*
* TFConstants.h
*
* This header holds all common constants and types needed.
*
* Author: Rapid Dojo
* Date: Oct 19, 2007
*/

#ifndef TFConstants_H
#define TFConstants_H

#include <PA9.h>       // Included for PA_Lib

//if the language is set to french (default in IdeaS)
#define IS_EMULATOR (PA_UserInfo.Language==2)

//define types
typedef int HRESULT;

//general constants
#ifndef NULL
#define NULL 0
#endif

#define SCREEN_TOP 1
#define SCREEN_BOTTOM 0
#define SCREEN_BOTH 2

#define PIECE_POINTS 3

#define BOARD_SQUARE_SIZE 24
#define BOARD_DIMENSION 8
#define NUMBER_OF_FLAGS 3
#define NUMBER_OF_TROOPS 3

//Error codes
#define S_OK 0
#define E_FAIL -999

//Game Mode
enum TF_GAME_MODE {
	SPLASH_WARNING, 
	SPLASH_UNCC, 
	SPLASH_LOGO, 
	SPLASH_MAIN, 
	MENU, 
	GAME_ONEPLAYER, 
	GAME_TWOPLAYER,
	PAUSE, 
	GAME_OVER, 
	RED_WINS,
	BLUE_WINS,
	CONFIRM_QUIT,
	NO_MODE
};

enum TF_TURN_STATE {
	SETUP,
	NORMAL,
	NEW_TURN,
	END,
	NEW_GAME
};


enum TF_SELECTION {
	SELECTED,
	NOT_SELECTED
};

enum TF_BUTTONS {
	BTN_QUIT,
	BTN_TROOP,
	BTN_BARRICADE,
	BTN_FLAG,
	BTN_RAND,
	BTN_RULES
};

enum TF_MENU_MODE{
	MAIN_MENU,
	OPTIONS_MENU,
	CREDITS_MENU,
	HELP_MENU,
	NO_MENU_SHOWING
};

enum TF_PIECE_STATE {
	EMPTY,
	FLAG_0,
	FLAG_1,
	FLAG_2,
	BARRICADE_1,
	BARRICADE_2,
	BARRICADE_3,
	TROOP_PIECE,
	FLAG_BARRICADE,
	TF_PIECE_STATE_NULL
};

enum TF_WINNER{
	BLUE_WINNER,
	RED_WINNER,
	NO_WINNER
};

enum TF_ADD_PIECE {
	BARRICADE,
	TROOP_TEMP,
	FLAG,
	FLAG_FORTIFICATION,
	TF_ADD_PIECE_NULL
};

enum TF_PLAYERS {
	RED_PLAYER,
	BLUE_PLAYER,
	AI_PLAYER,
	NO_PLAYER	
};

//enum of all the menu options in all the menus
enum TF_MENU_OPTION{
	ONE_PLAYER,
	TWO_PLAYER,
	OPTIONS,
	HELP,
	CREDITS,
	SOUNDS,
	MUSIC,
	OPTIONS_BACK,
	CONTROLS,
	HOW_TO_PLAY,
	HELP_BACK,
	NO_OPTION
};

enum TFSound{
	SOUND_MENU_MOVE, //knock1
	SOUND_MENU_SELECT, //knock2
    SOUND_SELECT_PIECE,//click1
    SOUND_INVALID_MOVE,//click2
    SOUND_MOVE_TROOP_RED,
    SOUND_MOVE_TROOP_BLUE,
	SOUND_KNOCK_TROOP_RED, //troophooh
	SOUND_KNOCK_TROOP_BLUE, //troopno
    SOUND_PLACE_TROOP_RED, //blueok
	SOUND_PLACE_TROOP_BLUE,//redroger
    SOUND_PLACE_BARRICADE,
    SOUND_PLACE_FLAG,
    SOUND_FORTIFY_FLAG,
    SOUND_NEXT_TURN,
    SOUND_CAPTURE_FLAG
};

enum TFMusic{
	MUSIC_BACKGROUND_INTRO,
    MUSIC_FACEOFF,
    MUSIC_FIRST_BLOOD,
    MUSIC_DANGER,
    MUSIC_WINNER
};


#define MENU_UP 0
#define MENU_DOWN 1

//macro functions
#define RETURN_ON_ERROR(HR) \
	{if(HR < 0) return HR;} \



#endif
